﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presentation.ControlWPF.TransitionControl;
using University.Workshop.Presenters.Square.Show;

namespace University.Workshop.Presentation.Square.Show
{
    /// <summary>
    /// Interaction logic for PageShowView.xaml
    /// </summary>
    public partial class PageShowView : Page, IShowSquareView
    {
        PresenterShowSquare pShowSquare;
        public PageShowView(Model.Square square)
        {
            InitializeComponent();
            pShowSquare = new PresenterShowSquare(this,square);
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {            
            pShowSquare.FirstTime();
        
        }

        private void GoStepOne_Click(object sender, RoutedEventArgs e)
        {
            pShowSquare.GoStepOne();
        }

        private void GoStepTwo_Click(object sender, RoutedEventArgs e)
        {
            pShowSquare.GoStepTwo();
        }

        private void btnRegisterMedicine_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new SearchSquare());
        }

        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            pShowSquare.GoBackPage();
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            pShowSquare.GoNextPage();
        }

        public void CallSecondPage()
        {
            PageSecondStepShowSquare pp = new PageSecondStepShowSquare(pShowSquare);
            ShowBasic = pp;
            frmContent.Navigate(pp);
        }

        public void CallFirstPage()
        {

            PageFirstStepShowSquare pp = new PageFirstStepShowSquare(pShowSquare);
            ShowBasic = pp;
            frmContent.Navigate(pp);
        }

        public IShowSquareBasicView ShowBasic
        {
            get;
            set;
        }


        public void OpenImage(string p)
        {
            Process.Start(@p);
        }
    }
}
